﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta name="keywords" content="jQuery Calendar, Month Calendar, MonthCalendar, DateTimeInput, DateTimePicker, Date Picker" />
    <meta name="description" content="This demo demonstrates the jqxCalendar widget. Choose a date and navigate through the months by clicking the left or right navigation arrows.
The jqxCalendar has built-in Keyboard navigation so you can click on it and navigate by using the left, right, up or down arrow keys." />
    <title id='Description'>This demo demonstrates the jqxCalendar's range selection mode. Click on a date to select the start date and then click on another cell to select the end date.</title>
    <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
    <script type="text/javascript" src="../../scripts/gettheme.js"></script>
    <script type="text/javascript" src="../../scripts/jquery-1.8.2.min.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxdatetimeinput.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxcalendar.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxtooltip.js"></script>
    <script type="text/javascript" src="../../jqwidgets/globalization/jquery.global.js"></script>
</head>
<body class='default'>
    <div id='content'>
        <script type="text/javascript">
            $(document).ready(function () {
                var theme = getTheme();
                // create jqxcalendar.
                $("#jqxWidget").jqxCalendar({ width: 250, height: 250, theme: theme, selectionMode: 'range' });

                $("#jqxWidget").bind('cellSelected', function () {
                    var selection = $("#jqxWidget").jqxCalendar('getRange');
                    $("#selection").html("From: " + selection.from.toLocaleDateString() + " <br/>To: " + selection.to.toLocaleDateString());
                });
                 
                var date1 = new Date();
                date1.setFullYear(2012, 7, 7);

                var date2 = new Date();
                date2.setFullYear(2012, 7, 15);
                $("#jqxWidget").jqxCalendar('setRange', date1, date2);
            });
        </script>
        <div id='jqxWidget'>
        </div>
        <div style='font-size: 13px; font-family: Verdana;' id='selection'></div>
    </div>
</body>
</html>
